package cn.zhentao.service.impl;

import cn.zhentao.pojo.Products;
import cn.zhentao.mapper.ProductsMapper;
import cn.zhentao.pojo.QueryPage;
import cn.zhentao.service.IProductsService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author mp
 * @since 2025-06-19
 */
@Service
public class ProductsServiceImpl extends ServiceImpl<ProductsMapper, Products> implements IProductsService {

    @Autowired
    private ProductsMapper productsMapper;


    @Override
    public Page<Products> findAllPage(QueryPage queryPage) {
        Page<Products> page=new Page<>(queryPage.getCurrent(), queryPage.getSize());

        QueryWrapper<Products> wrapper=new QueryWrapper<>();
        Page<Products> page1 = productsMapper.selectPage(page, wrapper);

        return page1;
    }
}

